package homework;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/*
* 输出key-value设计 ---》key为每行数字，且转化为longintable类型，value为1
*/

public class SortMapper extends Mapper<LongWritable, Text,LongWritable,LongWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context)
            throws IOException, InterruptedException {
        String line=value.toString();
        context.write(new LongWritable(Integer.parseInt(line)), new LongWritable(1));
    }
}
